<%--
  Created by IntelliJ IDEA.
  User: ZhuoWen
  Date: 2022/5/9
  Time: 16:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        System.out.println("a.jsp页面执行了");
        Object user = session.getAttribute("user");
        if (user==null){
            //如果user==null，说明还没有登录
            request.getRequestDispatcher("login.jsp").forward(request,response);
            return;//一般在请求转发后，就不允许执行后面的任何代码
        }
    %>
    这是a.jsp
</body>
</html>
